import { createPinia, defineStore } from 'pinia'
import persist from 'pinia-plugin-persistedstate' //导入持久化插件
import global from '@/assets/scss/global.module.scss'

// 创建pinia实例
const pinia = createPinia()
// 使用pinia插件
pinia.use(persist)
pinia.state
export const useTestStore = defineStore('test', {
  state: () => ({
    BoxTheme: {
      currentTheme: {
        fontColor: global.blueFont,
        lightColor: global.blueLight,
        hoverColor: global.blueHover,
        pressedColor: global.bluePressed
      },
      blueTheme: {
        fontColor: global.blueFont,
        lightColor: global.blueLight,
        hoverColor: global.blueHover,
        pressedColor: global.bluePressed
      },
      redTheme: {
        fontColor: global.redFont,
        lightColor: global.redLight,
        hoverColor: global.redHover,
        pressedColor: global.redPressed
      }
    }
  }),
  actions: {}
})

// 导出pinia实例，给main使用
export default pinia
